// 类的多态

class Animal {
  action() {
    console.log('animal action');
  }
}
class Dog extends Animal {
  action(): void {
    console.log('Dog action')
  }
}
class Fish extends Animal {
  action(): void {
    console.log("Fish action");

  }
}
class Bird extends Animal {
  action(): void {
    console.log('bird action');
  }
}

function test(anmials: Animal[]) {
  anmials.forEach(item => {
    item.action()
  })
}

test([new Dog(), new Fish(), new Bird()])

// export {
//   test
// }